<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo1"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<body>

<div class="layui-card">

    <div class="layui-card-header">
        <span class="layui-icon font-s10 color-desc margin-right-5"></span>结算明细
        <div class="pull-right">
<!--            <button data-table-id="NoticeTable" class="layui-btn layui-btn-primary  layui-btn-sm" data-modal="/system/user/form" data-height="720px" data-width="800px">-->
<!--                <i class=" layui-icon layui-icon-addition"></i>新建护工</button>-->
        </div>
    </div>

    <div class="layui-card-line"></div>

    <div class="layui-card-body">

        <div class="layui-card-table layui-tab">
            <div class="layui-tab-content">
                <form th:replace="/pcs/settlement/index_search">

                </form>
                <div>
                    <p style="text-align: right;font-size: 16px;">
                        累计陪护金额：<span class="layui-font-green" th:if="${careOrderAmount>0}">[[${careOrderAmount}]]元</span>
                        累计陪诊金额：<span class="layui-font-blue"  th:if="${consultationOrderAmount>0}">[[${consultationOrderAmount}]]元</span>
                        累计陪检金额：<span class="layui-font-orange"  th:if="${inspectionOrderAmount>0}">[[${inspectionOrderAmount}]]元</span>
                    </p>
                </div>
                <table id="SettlementListTable"  data-url="/pcs/settlement/list"  data-target-search="form.form-search"></table>
                <script type="text/javascript" th:inline="none">
                    $(function () {
                        $('#SettlementListTable').layTable({
                            even: true, height: 'full',
                            cols: [[
                                {title: '序号', type: 'numbers', width: 80},
                                {field: 'orderNo', title: '账单号', minWidth: 180, align: 'center'},
                                {field: 'name', title: '患者姓名', minWidth: 90, align: 'center'},
                                {field: 'phone', title: '患者手机号', minWidth: 90, align: 'center'},
                                {title: '住院时间', minWidth: 180, align: 'center',templet: function (d) {
                                        if(d.dischargeTime==null){
                                            return d.admissionTime;
                                        }else{
                                            return d.admissionTime+"~"+d.dischargeTime;
                                        }

                                    }},
                                {field: 'admissionStatus', title: '是否出院', minWidth: 120, align: 'center',templet: function (d) {
                                        if(d.admissionStatus==1){
                                            return '未出院';
                                        }else{
                                            return '已出院';
                                        }
                                    }},
                                {field: 'amount', title: '总计费用', minWidth: 180, align: 'center'},
                                {toolbar: '#toolbar', title: '操作', align: 'center', minWidth: 280, fixed: 'right'}
                            ]]
                        });
                    });



                </script>


                <script type="text/html" id="toolbar">
                    <a class="layui-btn layui-btn-sm" data-event-dbclick data-title="查看"  data-width="1400px" shiro:hasPermission="pcs:settlement:detail"  data-modal='/pcs/settlement/detail?id={{d.id}}'>查看</a>

                </script>

            </div>
        </div>
    </div>

</div>
</body>
</html>